package me.zk.practice1.s;

import java.util.Arrays;
import java.util.HashSet;
import java.util.Set;

/**
 * @author zhangkai
 * @date 2023/7/18 17:22
 */
public class LS_Offer_61 {

    public boolean isStraight(int[] nums) {
        Set<Integer> set = new HashSet<>();
        int min = 14;
        int max = 0;
        for (int num : nums) {
            if (num == 0) {
                continue;
            }
            if (set.contains(num)) {
                return false;
            }
            min = Math.min(min, num);
            max = Math.max(max, num);
            set.add(num);
        }
        return max - min < 5;
    }


}
